Conditions | 1 |
Total Lines | 19 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | import {chat_v1 as chatV1} from 'googleapis/build/src/apis/chat/v1'; |
||
26 | |||
27 | /** |
||
28 | * Creates an action response with specific type |
||
29 | * ref: https://developers.google.com/chat/api/reference/rest/v1/spaces.messages#responsetype |
||
30 | * @param {object} message - Card message either text or cardsV2 |
||
31 | * @returns {object} - ActionResponse |
||
32 | */ |
||
33 | export function createDialogActionResponse(message: object) { |
||
34 | const responseBody: chatV1.Schema$Message = { |
||
35 | actionResponse: { |
||
36 | type: 'DIALOG', |
||
37 | dialogAction: { |
||
38 | dialog: { |
||
39 | body: message, |
||
40 | }, |
||
41 | }, |
||
42 | }, |
||
43 | }; |
||
44 | return responseBody; |
||
45 | } |
||
46 |